/*--------------------------------------------------
* @Description:     问卷管理详情                     *
* @Version:         1.0.0                           *
* @author:          zhangmengqi (1845955175@qq.com)  *
* @date             2017.11.15                      *
---------------------------------------------------*/
$(function(){
/*********************************************函数调用********************************************************************/
    /*
        发送详情页id
    */
    sendId();
/*********************************************事件绑定********************************************************************/

    /*
        发送详情页id
    */
    function sendId(){
         var id = $('.hidId').val(),
            event = $('.eventId').val();
        $.ajax({
            type: jQuery.url.SignUpManagement.personSignUp.type,
            url: jQuery.url.SignUpManagement.personSignUp.url,
            contentType: "application/x-www-form-urlencoded; charset=utf-8",
            data: {
               id: id,
               eventId: event
            },     //JSON.stringify
            dataType: "json",
            success: function (rs) {
                if( rs.code == 0){ 
                    detailData(rs);//详情页刷数据
                }
            },
            error: function (message) {
                
            }
        });
    }
    /*
        刷详情页数据
    */
    function detailData(rs){
        var str = '';
        $.each(rs.list, function(index, item){
            str += '<div class="form-group">\
                        <label class="col-sm-5 control-label">'+item.name+' :</label>\
                        <div class="col-sm-5">';
            if(item.type == 6){
                str += '<img src="'+item.content+'">\
                        </div>\
                    </div>';
            }else{
                str += '<input readonly class="new500  border0" type="text"  value="'+item.content+'"/>\
                        </div>\
                    </div>';
            }
        });
        $('.panel-body').prepend(str);
    }
});